<?php
namespace Admin\Controller;
use Think\Controller;
class SiteController extends Controller{
    public function indexAction(){
        //获得站点信息
        $model = M();
        $sql = "select * from site";
        $site = $model->query($sql);
        $site = $site[0];
//        var_dump($site);
        $this->assign('site',$site);
        $this->display('index');
    }
    //站点信息修改方法
    public function reviseAction(){
        $websitename = I('post.websitename');
        $sitelntro = I('post.sitelntro');
        $keyword = I('post.keyword');
        $icp = I('post.icp');
//        var_dump($websitename,$sitelntro,$keyword,$icp);
        $model = M();
        $sql = "update site set websitename='{$websitename}',sitelntro='$sitelntro',keyword='{$keyword}',icp='{$icp}'";
        $model->execute($sql);
        $this->success('修改成功',U('Admin/Site/index'),2);


    }
}